<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\matchingRule\validate;

use think\Validate;

/**
 * 匹配规则验证器
 */
class MatchingRuleValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'rule_name_zh' => 'require',
        'rule_level' => 'require',
        'rule_type' => 'require',
        'parent_id' => 'require',
        'is_required' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'rule_name_zh' => '规则名称中文名称必须填写',
        'rule_level' => '规则等级必须填写',
        'rule_type' => '规则类型必须填写',
        'parent_id' => '父级id必须填写',
        'is_required' => '是否必填必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'rule_name_zh',
            'rule_level',
            'rule_type',
            'parent_id',
            'is_required',
        ],
        'update' => [
            'rule_name_zh',
            'rule_level',
            'rule_type',
            'parent_id',
            'is_required',
        ],
    ];

}
